﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SolutionSorter.Core
{
    public class SortManager
    {
        public SortManager(IContentManager contentManager, IContentSorter contentSorter)
        {
            _contentManager = contentManager;
            _contentSorter = contentSorter;
        }

        public void SortSolutionFile()
        {
            string content = _contentManager.GetContent();
            if (!string.IsNullOrEmpty(content))
            {
                string sortedContent = _contentSorter.SortContent(content);
                _contentManager.SaveContent(sortedContent);
            }
        }

        private readonly IContentManager _contentManager;
        private readonly IContentSorter _contentSorter;
    }
}
